package com.to_door_recycle.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 规格表
 * @TableName specification
 */
@TableName(value ="specification")
@Data
public class Specification implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 规格名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 所有具体规格值
     */
    @TableField(value = "all_values")
    private String allValues;

    /**
     * 可使用状态下不同规格值对应的规格估价
     */
    @TableField(value = "normal_appraise_values")
    private String normalAppraiseValues;

    /**
     * 不可使用状态下不同规格值对应的规格估价
     */
    @TableField(value = "abnormal_appraise_values")
    private String abnormalAppraiseValues;

    /**
     * 分类id
     */
    @TableField(value = "category_id")
    private Long categoryId;

    /**
     * 用户的最近一次的编辑时间
     */
    @TableField(value = "edit_time")
    private Date editTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Specification other = (Specification) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getAllValues() == null ? other.getAllValues() == null : this.getAllValues().equals(other.getAllValues()))
            && (this.getNormalAppraiseValues() == null ? other.getNormalAppraiseValues() == null : this.getNormalAppraiseValues().equals(other.getNormalAppraiseValues()))
            && (this.getAbnormalAppraiseValues() == null ? other.getAbnormalAppraiseValues() == null : this.getAbnormalAppraiseValues().equals(other.getAbnormalAppraiseValues()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getEditTime() == null ? other.getEditTime() == null : this.getEditTime().equals(other.getEditTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getAllValues() == null) ? 0 : getAllValues().hashCode());
        result = prime * result + ((getNormalAppraiseValues() == null) ? 0 : getNormalAppraiseValues().hashCode());
        result = prime * result + ((getAbnormalAppraiseValues() == null) ? 0 : getAbnormalAppraiseValues().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getEditTime() == null) ? 0 : getEditTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", allValues=").append(allValues);
        sb.append(", normalAppraiseValues=").append(normalAppraiseValues);
        sb.append(", abnormalAppraiseValues=").append(abnormalAppraiseValues);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", editTime=").append(editTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}